package com.szholly.plug.cms.entity.notice;

import java.util.HashMap;

import org.springframework.stereotype.Component;

import com.szholly.utils.spring.SpringBeanFactory;
import com.szholly.data.general.*;
import com.szholly.data.general.metadata.IBaseTable;

/**
 * 系统通知，工作提醒
 */
@Component("cms_systemnotice")
public class SystemNoticeTable extends InterceptorTableBase implements IBaseTable {

	public final static String TABLE_NAME = "cms_systemnotice";

	/**
	 * single ref
	 */
	public static SystemNoticeTable getSingleRef() {
		return (SystemNoticeTable) SpringBeanFactory.getBean("cms_systemnotice");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "工作提醒表";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_GUID);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(1);
			itemField.setFieldAliasName("GUID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);

			itemField = new Field();
			itemField.setFieldName(SystemNoticeRow.FIELD_Dxtz);
			itemField.setDataType(GlobalDataType.Char);
			itemField.setFieldID(4);
			itemField.setFieldAliasName("短信通知");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);

			itemField = new Field();
			itemField.setFieldName(SystemNoticeRow.FIELD_Fsnr);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(6);
			itemField.setFieldAliasName("发送内容");
			itemField.setCanShow(false);
			itemField.setMaxLen(2000);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);

			itemField = new Field();
			itemField.setFieldName(SystemNoticeRow.FIELD_Fsr);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(7);
			itemField.setFieldAliasName("发件人");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);

			itemField = new Field();
			itemField.setFieldName(SystemNoticeRow.FIELD_Jsr);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(8);
			itemField.setFieldAliasName("接收人");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);

			itemField = new Field();
			itemField.setFieldName(SystemNoticeRow.FIELD_Qdsj);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(9);
			itemField.setFieldAliasName("确定时间");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);

			itemField = new Field();
			itemField.setFieldName(SystemNoticeRow.FIELD_Fssj);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(10);
			itemField.setFieldAliasName("发送时间");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);

		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "门户";
	}
}